<?php
/* vim: set ts=4 sw=4: */
/*
* @package
* @filename	   Loader.php
* @author	   Garfield <garfield0601@gmail.com>
* @copyright 	
* @version 
* @since  	   2008-6-29 22:52:14
* 
*/
abstract class SmartPHP_Loader
{
    public static function loadClass($class)
    {
        if (class_exists($class, false) || interface_exists($class, false)) {
            return;
        }

        $file = str_replace('_', DIRECTORY_SEPARATOR, $class) . '.php';
		include_once $file;

        if (!class_exists($class, false) && !interface_exists($class, false)) {
            require_once 'SmartPHP/Exception.php';
            throw new SmartPHP_Exception("File \"$file\" does not exist or class \"$class\" was not found in the file");
        }
    }

}

